<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .success{
            color:green;
        }
        .error{
            color:red;
        }
    </style>
</head>
<body>
    <h1>上传文档</h1>
    <a href="{{ url_for('home') }}">返回首页</a>
    <form method="post" enctype="multipart/form-data" action="{{ url_for('upload_doc')}}">
        <input type="file" name="file" accept=".txt,.docx,.pdf"/>
        <button type="submit">上传文档</button>
    </form>

    {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
            <ul>
                {% for category, message in messages%}
                    <li class="{{category}}">{{message}}</li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endwith %}
    
</body>
</html>